<template>
  <el-dialog
    class="gl_dialog_TitleLine"
    width="780px"
    title="送审进度"
    :visible.sync="approveDialogVisible"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    append-to-body
  >
    <el-table v-loading="tableLoading" class="gl_mb_15 game_table_list" :data="tableData" stripe size="mini" style="width: 100%">
      <el-table-column prop="unitName" label="审核流程" :width="150" />
      <el-table-column prop="approveStatus.name" label="审核进度" :width="150" />
      <el-table-column prop="approveResult.name" label="审核结果" :width="150" />
      <el-table-column prop="comment" label="结果反馈" :min-width="200" />
    </el-table>
  </el-dialog>
</template>
<script>
import { api_GET_EventsManagementCompetitionApproveApproveStatusCompetitionId } from '@/extend/api/gameswaggerApi/app';
export default {
  data() {
    return {
      tableLoading: false,
      tableData: [],
      approveDialogVisible: false
    };
  },
  methods: {
    open(gameInfo) {
      this.gameId = gameInfo.id;
      this.getApproveProgress();
      this.approveDialogVisible = true;
    },
    // 获取审核进度
    getApproveProgress() {
      this.tableLoading = true;
      api_GET_EventsManagementCompetitionApproveApproveStatusCompetitionId(this.gameId).then(res => {
        console.log(res);
        this.tableData = res || [];
        this.tableLoading = false;
      }, error => {
        this.tableLoading = false;
        this.$message({ type: 'error', message: error.error && error.error.code || '' });
      });
    }
  }
};
</script>
